From 0ccd682c8ed843abc2fbbb60cb1d4b347d9d5008 Mon Sep 17 00:00:00 2001 From: robertl Date: Thu, 7 Apr 2005 20:14:38 +0000 Subject: [PATCH] Add runtime test that endpoints were correctly parsed. --- jeeps/gpslibusb.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/jeeps/gpslibusb.c b/jeeps/gpslibusb.c index fb90ce8c5..dadab59b4 100644 --- a/jeeps/gpslibusb.c +++ b/jeeps/gpslibusb.c @@ -54,7 +54,7 @@ static void garmin_usb_syncup(void); gusb_init(void) { -//usb_set_debug(99); +// usb_set_debug(99); usb_init(); usb_find_busses(); usb_find_devices(); @@ -183,7 +183,15 @@ garmin_usb_start(struct usb_device *dev) } } - garmin_usb_syncup(); + /* + * Zero is the configuration endpoint, so if we made it through + * that loop without non-zero values for all three, we're hosed. + */ + if (gusb_intr_in_ep && gusb_bulk_in_ep && gusb_bulk_out_ep) { + garmin_usb_syncup(); + } else { + fatal("Could not identify endpoints on USB device.\nFound endpoints Intr In %d Bulk Out %d Bulk In %d\n", gusb_intr_in_ep, gusb_bulk_out_ep, gusb_bulk_in_ep); + } return; } -- 2.30.2